<%@ page language="java" pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="s" uri="/struts-tags"%>

<table width="100%">
	<tr>
		<td height="40" colspan="2" class="sectionheading bottom-border">
			Theme Manager
		</td>
	</tr>
	<tr>
		<td class="verdana11greynormal">
			<b>Create New Theme</b>
		<s:form action="createNewTheme.htm" method="post" id="form" theme="simple">
			<table>
				<tbody>
					<tr>
						<td colspan="2">
							<s:actionerror cssClass="Note-red" theme="simple" />
							<s:actionmessage cssClass="verdana11greynormal" theme="simple" />
						</td>
					</tr>
					<tr>
						<td class="verdana12blacknormal">
							Copy from theme:
						</td>
						<td>
							<s:select list="themeManagerList" listKey="floderName" listValue="themeName" name="copyFrom" value="copyFrom" theme="simple" />
						</td>
					</tr>
					<tr>
						<td class="verdana12blacknormal">
							New Theme Name:
						</td>
						<td>
							<table>
								<tr>
									<td>
										<s:textfield name="newThemeName" theme="simple" value="" size="30" maxlength="255" cssClass="Textfiled-border" />
									</td>
									<td>
										<s:submit theme="simple" type="image"
											src="../Admin-Images/create-btn.gif" align="left"
											value="Create" />
									</td>
									<td>
										<img style="cursor: pointer;"
									onclick="document.getElementById('form').reset();"
									src="../Admin-Images/reset-button.gif" alt="Reset" title="Reset">
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
						</td>
					</tr>
				</tbody>
			</table>
		</s:form>
			<br>
		<s:form action="deleteTheme.htm" method="post" id="deleteform" theme="simple">
			<table>
				<tbody>
					<tr>
						<td class="verdana11greynormal">
							<b>Delete Theme</b>
						</td>
					</tr>
				</tbody>
			</table>
			<table>
				<tbody>
					<tr>
						<td class="verdana12blacknormal">
							Select Theme:
						</td>

						<td>
							<table>
								<tr>
									<td>
										<s:select list="themeManagerList" listKey="floderName" listValue="themeName" name="copyFrom" value="copyFrom" theme="simple" />
									</td>
									<td>
										<s:submit theme="simple" type="image"
											src="../Admin-Images/delete_btn.gif" align="left"
											value="Delete" onclick="return wantToDelete('Are You sure you want to delete theme');" />
									</td>
									<td>
										<img style="cursor: pointer;"
									onclick="document.getElementById('deleteform').reset();"
									src="../Admin-Images/reset-button.gif" alt="Reset" title="Reset">
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</tbody>
			</table>
		</s:form>
			<br>
		<s:form action="assignTheme.htm" method="post" id="assignThemefrm" theme="simple">
			<table>
				<tbody>
					<tr>
						<td class="verdana11greynormal">
							<b>Assign themes to languages</b>
						</td>
					</tr>
					<tr>
						<td>
							<table>
								<tbody>
									<tr>
										<td>
											<table>
												<s:iterator value="languagesList">
													<tr>
														<td class="verdana11greynormal"><s:property value="languageCode" /></td>
														<td>
															<s:select list="themeManagerList" listKey="id" name="languagesMap['%{languageCode}'].themeId.id" value="%{themeId.id}" listValue="themeName" theme="simple" />
															<s:hidden name="languagesMap['%{languageCode}'].languageCode" value="%{languageCode}" />
															<s:hidden name="languagesMap['%{languageCode}'].languageName" value="%{languageName}" />
															<s:hidden name="languagesMap['%{languageCode}'].active" value="%{active}" />
															<s:hidden name="languagesMap['%{languageCode}'].default_" value="%{default_}" />
															<s:hidden name="languagesMap['%{languageCode}'].text" value="%{text}" />
															<s:hidden name="languagesMap['%{languageCode}'].chromeCss" value="%{chromeCss}" />
														</td>
													</tr>
												</s:iterator>
											</table>
										</td>
									</tr>

								</tbody>
							</table>
							<br>

							<s:submit theme="simple" type="image"
								src="../Admin-Images/save-chagnes-button.gif" align="left"
								value="SaveChanges" />
							<img style="cursor: pointer;"
									onclick="document.getElementById('assignThemefrm').reset();"
									src="../Admin-Images/reset-button.gif" alt="Reset" title="Reset">
						</td>

					</tr>
				</tbody>
			</table>
		</s:form>
		</td>
	</tr>
</table>